from django.http import HttpResponse
from django.shortcuts import render


def index(request):
    return HttpResponse("Hello, world. You're at the polls index.")


# def runoob(request):
#     views_list = ["菜鸟教程1", "菜鸟教程2", "菜鸟教程3"]
#     return render(request, "runoob.html", {"views_list": views_list})

# def runoob(request):
#     name = "菜鸟教程"
#     return render(request, "runoob.html", {"name": name})


# def runoob(request):
#     import datetime
#     now = datetime.datetime.now()
#     return render(request, "runoob.html", {"time": now})

'''
自定义路由
'''


# def runoob(request):
#     views_str = "<a href='https://www.runoob.com/'>点击跳转</a>"
#     return render(request, "runoob.html", {"views_str": views_str})

# 测试判断语句的实现
# def runoob(request):
#     views_num = 88
#     return render(request, "runoob.html", {"num": views_num})


# def runoob(request):
#     views_list = ["菜鸟教程", "菜鸟教程1", "菜鸟教程2", "菜鸟教程3", ]
#     return render(request, "runoob.html", {"views_list": views_list})


def runoob(request):
    name = "菜鸟教程"
    return render(request, "runoob.html", {"name": name})
